PackageTool is an application illustrating how to create application packages in Mac OS 9. It provides a simple interface for converting correctly formatted folders into packages and vice versa.
You may incorporate this sample code into your applications without restriction, though the sample code has been provided "AS IS" and the responsibility for its operation is 100% yours. However, what you are not permitted to do is to redistribute the source as "DSC Sample Code" after having made changes. If you're going to re-distribute the source, we require that you make it clear in the source that the code was descended from Apple Sample Code, but that you've made changes.
Features in version 1.3:
• Revisited the UpdateRelativeAliasFile routine defined in Utilities.h to include an optional create-if-necessary parameter. It has been enhanced to it is possible to use it to create alias files referring to folders.
• Better CarbonLib combatibility.
• Revisited the package conversion code in PackageWindow.c making it so it performs better verification of folders before attempting to turn them into packages.
Features in version 1.2:
• Added navigation services dialogs.
• Fixed up some CarbonLib incompatibilities.
• Added routine NavReplyToODOCList to Utilities.c that shows how to convert document lists returned by Navigation Services into document lists that have the same format and contents as the ones the Finder passes to your application's 'odoc' Apple event handler. The idea here being that your application only needs to have one document opening routine once the two lists have been converted to the same format.
New features in version 1.1:
• This version of the PackageTool was compiled with CarbonLib.
• A bug in the Alias Manager makes it impossible to create a 'relative alias' file that refers to a file in the same directory. As a result, it is not possible to create a Mac OS 9 package where the alias refers to a file in the package's root directory. However, since the ResolveAliasFile routine uses the alias file itself as the relative file when resolving targets, and, when resolving alias chains, it will use each alias file along the way as the relative file, there is a work around that will allow you to place the package's main file in the package's root directory. Here, it is necessary to create a sub-directory and use two alias files as shown below:
The PackageTool sample has been revised so that when it finds a situation where the main file is in the package's root directory, it will automatically create a sub-directory and build the alias chain for you.
• Calls to the standard C library have been removed from the sources.
• The dlgx resources were modified so the dialog manager now creates a control heirarchy when creating the main window. This was done because under Mac OS X, the user item is not drawn unless a control heirarchy is built.
Features in version 1.0:
Mac OS 9 Package Related techniques illustrated include:
':Sample Package:' - an example package including the 'package aware' HTMLSample application. Therein you will find an example package document and an example package application.
MakeFile - MPW make file.
PackageTool - the PackageTool application.
PackageTool.c - main program and event dispatching for the PackageTool application.
PackageTool.h - constant definitions and routine prototypes for the PackageTool application.
PackageTool.prj - CodeWarrior project file for building the application.
PackageTool.r - MPW Rez file the the application.
PackageTool.rsrc - ResEdit resource file for the resources used in the application.
PackageUtils.c - Utilities package savy applications can use for identifying packages.
PackageUtils.h - routine prototypes for routines defined in PackageUtils.c.
PackageWindow.c - routines implementing the window displayed by the PackageTool application.
PackageWindow.h - routine prototypes for routines defined in PackageWindow.c.
'Re- C/F Registration Request' - creator file type registration for the PackageTool application.
ReadMe - see ReadMe.
SimplePrefs.c - routines for implementing preferences files as a datafork containing a flattened collection.
SimplePrefs.h - routine prototypes for routines defined in SimplePrefs.c.
Utilities.c - utility routines set aside to simplify the main example.
Utilities.h - routine prototypes for routines defined in Utilities.c.